package cc.magicjson.synthesis.model;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 优惠券类，包含优惠券的基本信息和使用规则
 */
@Getter
@Setter
@ToString
public class Coupon {
    private final String id;
    private final String name;
    private final BigDecimal thresholdAmount; // 满多少金额可用
    private final BigDecimal discountAmount;  // 优惠金额
    private final LocalDateTime startTime;
    private final LocalDateTime endTime;
    private boolean used;  // 是否已使用

    public Coupon(String id, String name, BigDecimal thresholdAmount,
                  BigDecimal discountAmount, LocalDateTime startTime,
                  LocalDateTime endTime) {
        this.id = id;
        this.name = name;
        this.thresholdAmount = thresholdAmount;
        this.discountAmount = discountAmount;
        this.startTime = startTime;
        this.endTime = endTime;
        this.used = false;
    }

}
